#ifndef CHARACTER_H__
#define CHARACTER_H__

#include <list>
#include <string>
#include <fstream>

using std::list;
using std::string;
using std::istream;

#include "Effect.h"
#include "Board.h"

class Character {
public:
	Character();
	Character(istream&, SpellSet&);
	Character(Character&);
	~Character() = default;

	//basic attributes
private:
	BoardSide _side;

	bool _dead;
	int _hp, _mp, _hpMax, _mpMax;
	int _attack, _defence, _range;
public:
	const BoardSide& side = _side;
	const bool& dead = _dead;
	const int& hp = _hp;
	const int& mp = _hp;
	const int& hpMax = _hpMax;
	const int& mpMax = _mpMax;
	const int& attack = _attack;
	const int& defence = _defence;
	const int& range = _range;

	bool checkDead();

	//action
private:
	int _actionPoint, _actionPointMax;
	SpellSet& spellSet; //2d array.

	list<EffectOnCharacter> currentEffects;
public:
	void fillActionPoint();
	void castSpellOn(Spell&, Character&);
	bool updateEffect(EffectOnCharacter&);
	void updateEffects();
};

#endif //CHARACTER_H__